home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / NEWSOFT / AUGUST / FREENET2 / !FreeNet / Docs / Setup < prev    next >
Text File  |  1996-10-13  |  9KB  |  210 lines

  1.                   Configuring the FreeNet TCP/IP Stack
  2.  
  3.                           (C) Tom Hughes 1995
  4.  
  5. 0. Copyright
  6.  
  7.   The FreeNet module and application and the tools and documentation
  8.   that go with them are all copyright. They are however released as
  9.   freeware subject to certain terms and conditions. These are described
  10.   in the file named 'Licence' which should have accompanied this
  11.   document.
  12.  
  13. 1. Overview
  14.  
  15.   Configuring FreeNet is a relatively simple process which requires the
  16.   editing of two scripts; one which starts up FreeNet and one which
  17.   shuts it down again.
  18.  
  19.   The first of these two scripts, !FreeUser.Startup, begins by loading
  20.   the necessary modules and then configures the interfaces and routing
  21.   ready for use. The second kills off all the modules, and returns the
  22.   system to its normal state.
  23.  
  24.   The remainder of this document details the various commands used in
  25.   the startup file to configure parts of the system. This, together with
  26.   the example provided with FreeNet should be sufficient to configure
  27.   FreeNet without any problems. Hopefully a future release of FreeNet
  28.   will include a desktop application to do this configuration.
  29.  
  30. 2. Installing additional hardware drivers
  31.  
  32.   If you wish to use a hardware driver other than those supplied with
  33.   FreeNet, you will to place the appropriate module in !FreeUser.Drivers
  34.   and then add a line to the startup script to load this driver.
  35.  
  36.   You can of course store the module somewhere else if you wish. The
  37.   named directory is simply provided as a convenient place where you may
  38.   wish to place it. Note that this is not the same as !FreeNet.Drivers
  39.   which is the directory used to hold the supplied drivers.
  40.  
  41.   The startup script will also need to be modified to load this driver
  42.   by adding an appropriate 'RMRun' command. If the driver has been
  43.   installed in !FreeUser.Drivers, you can use the FreeNet: path to
  44.   locate the driver, as in this example:
  45.  
  46.       RMRun FreeNet:Drivers.SLIPdriver
  47.  
  48.   This command would load a driver named SLIPdriver which was in either
  49.   !FreeUser.Drivers (for user installed drivers) or !FreeNet.Drivers
  50.   (for FreeNet supplied drivers).
  51.  
  52. 3. Configuring interfaces
  53.  
  54.   The first thing you will need to do after loading FreeNet and your
  55.   chosen hardware driver is to configure the interfaces that you wish to
  56.   use. You should note that some drivers (including the supplied SLIP
  57.   driver) will need some configuration before this can be done, and you
  58.   should consult the documentation supplied with the driver for the
  59.   relevant information.
  60.  
  61.   Once this has been done, the ifconfig command can be used to inform
  62.   FreeNet that the interface exists, and to set various relevant
  63.   options. The syntax of this command is as follows:
  64.  
  65.       ifconfig <interface> [inet <local-address> [<remote-address>]]
  66.                [netmask <mask>] [broadcast <address>] [arp] [up|down]
  67.                [revarp]
  68.  
  69.   Here, you should give the address that you wish to assign to the
  70.   interface as <local-address> and for point-to-point links like SLIP or
  71.   PPP connections, the address of the other end of the link should be
  72.   given for <remote-address>. Alternatively, specify revarp to cause
  73.   the address to be found by querying a server using RevARP.
  74.  
  75.   If the interface is on a network that has been subnetted, you will
  76.   need to specify an appropriate value for the netmask. If you don't
  77.   know what this should be, your sysadmin should be able to tell you.
  78.  
  79.   For broadcast networks such as ethernet, you can specify the address
  80.   to be used for broadcast packets on that network. This will default to
  81.   the standard 255.255.255.255 unless otherwise specified. You will also
  82.   need to include the arp flag when configuring an interface on a
  83.   broadcast network, to specify that the ARP protocol should be used to
  84.   resolve addresses on the local network.
  85.  
  86.   Finally, the interface is marked up or down by including the keyword
  87.   up or down in the ifconfig command line. An interface that is marked
  88.   down will not be used to transmit packets, so this can be used to
  89.   temporarily disable an interface.
  90.  
  91.   To summarise all this, consider the following examples of ifconfig
  92.   commands. The first example configures a SLIP interface with a local
  93.   address of 158.152.40.58 which talks to 158.152.1.222 at the other end
  94.   of the link:
  95.  
  96.       ifconfig sl0 inet 158.152.40.58 158.152.1.222 up
  97.  
  98.   An ethernet interface (ethernet interfaces are often ea0 or eb0, but
  99.   check your card's documentation to be sure) would be configured as
  100.   follows, where the host 163.162.5.45 is on subnet 163.162.5.0 of a
  101.   class B network whose number is 163.162.0.0, giving a netmask of
  102.   0xffffff00.
  103.  
  104.       ifconfig eb0 inet 163.162.5.45 netmask 0xffffff00 arp up
  105.  
  106.   This interface could be temporarily removed from operation using the
  107.   command:
  108.  
  109.       ifconfig eb0 down
  110.  
  111.   It would then be returned to use using the following:
  112.  
  113.       ifconfig eb0 up
  114.  
  115.   Once you have configured your interfaces, you should be able to obtain
  116.   a list of available interfaces using the command 'netstat -i'.
  117.  
  118. 4. Configuring the routing tables
  119.  
  120.   Having a system with properly configured interfaces is not much help
  121.   unless TCP/IP is told which packets to route through which interfaces,
  122.   and what address those packets should be addressed through. When an
  123.   interface is configured, a single route will be added to the routing
  124.   tables for that interface, which will be sufficient to reach some
  125.   local hosts.
  126.  
  127.   In the case of point-to-point links like SLIP, a route will have been
  128.   added for the remote address at the other end of the link. This will
  129.   allow you to talk to that machine but to nothing else. For interfaces
  130.   on broadcast networks such as ethernet, things are slightly better as
  131.   there will be a route to all hosts on the local (sub)net. You should
  132.   be able to use 'netstat -r' to see what routes are currently in the
  133.   routing tables.
  134.  
  135.   Adding and removing routes is done using the route command. The add
  136.   form of the command has the following syntax:
  137.  
  138.       route add <destination>[/<bits>] <gateway> <metric>
  139.  
  140.   Where <destination> is the address of a host or network that can be
  141.   reached via the host identified by <gateway>. The <metric> parameter
  142.   is an indication of the efficiency of that route compared to others to
  143.   the same destination.
  144.  
  145.   Normally, the destination address will be examined to see whether the
  146.   host part of the address is zero. If it is, the route will be treated
  147.   as a route to a network, otherwise it will be treated as a route to a
  148.   specific host. This can be overridden by specifying the number of bits
  149.   of the destination address which should be treated as significant.
  150.  
  151.   Where the destination is on a directly attached network, you should
  152.   specify your own address as the gateway, and give a metric of zero. In
  153.   other cases, the gateway should be the address of a machine on a
  154.   directly connected network that knows how to reach the specified
  155.   destination, and the metric should be non-zero.
  156.  
  157.   As an example, consider the following, which tells the machine from
  158.   our previous example (163.162.5.45) how to reach machines on the
  159.   subnet 163.162.12.0 of the local network:
  160.  
  161.       route add 163.162.12.0 163.162.5.1 1
  162.  
  163.   This says that addresses on subnet 163.162.12.0 can be reached by
  164.   sending packets to 163.162.5.1 which is on the directly connected
  165.   subnet (163.162.5.0) and knows how to reach the other subnet. By
  166.   comparison, the following tells the same machine how to reach the
  167.   local subnet (this would normally be done automatically by ifconfig of
  168.   course):
  169.  
  170.       route add 163.162.5.0 163.162.5.45 0
  171.  
  172.   One final, and vital point about adding routes is the setting of the
  173.   default route. This is done by specifing 'default' as the destination,
  174.   and this route will be used for any destination which does not have an
  175.   explicit route in the routing tables.
  176.  
  177.   Deleteing routes is accomplished by using the following, alternative
  178.   syntax of the route command:
  179.  
  180.       route delete <destination>[/<bits>] <gateway>
  181.  
  182.   Where the <destination> and <gateway> parameters are those given to
  183.   the original 'route add', and which can be displayed by using the
  184.   command 'netstat -r' to examine the routing tables.
  185.  
  186. 5. Checking your configuration
  187.  
  188.   Once you have configured your interfaces and routing tables, and
  189.   verified them using 'netstat -i' and 'netstat -r', you should be ready
  190.   to go.
  191.  
  192.   At this point, you will probably want to use the ping utility to
  193.   ensure that your machine can see other machines. In its simplest form,
  194.   you can simply type 'ping <address>' to test whether your machine can
  195.   see a particular remote machine. Full documentation for the ping tool
  196.   can be found in the appropriate file.
  197.  
  198.   Another useful utility is traceroute which will attempt to work out
  199.   what route a packet would follow to reach a given address. This is
  200.   useful in attempting to solve routing problems, and can be used by
  201.   entering 'traceroute <address>'. Full documentation of other options
  202.   for this tool are documented seperately.
  203.  
  204.   Other forms of the netstat command which you may also find useful
  205.   include 'netstat' which lists all sockets which are currently in
  206.   existence, 'netstat -s' which gives a large number of statistics about
  207.   the number and type of packets which have passed throught the TCP/IP
  208.   stack, and 'netstat -m' which reports how many memory buffers ar
  209.   currently free for use.
  210.